package com.woniuxy03;

public class Test04 {
    public static void main(String[] args) {
        //n  2^n-1
        //汉诺塔
        move("A","B","C",30);
    }

    static void move(String source,String help,String target,int num)  {
        if(num==1){
            System.out.println(source+"--->"+target);
        }else{
            move(source,target,help,num-1);
            System.out.println(source+"--->"+target);
            move(help,source,target,num-1);
        }
    }

}
